# 内置方法、魔术方法

class Student:
    name:str
    age:int

    # 目前测试，构造方法只能有一个，类似js
    def __init__(self,name=None,age=18):
        self.name=name
        self.age=age

    def __gt__(self, other):
        return self.age>other.age

    def __ge__(self, other):
        return self.age>=other.age

    def __eq__(self, other):
        return self.name==other.name

    def __str__(self):
        return f"name={self.name},age={self.age}"


if __name__ == '__main__':
    stu1=Student("张三",18)
    stu2=Student("李四",18)
    stu3=Student("王五",88)
    stu4=Student("张三",23)
    stu5=Student()

    print(stu1>=stu2)

    print(stu1==stu4)

    print(stu1)
    print(stu5)

    print(bool(""),bool("0"))